<!--文章模板-->
<#macro article id title url>
	<article id="${id}" class="format-standard type-post hentry">
		<header>
			<h3 class="post-title">
				<a href="${url}" >${title}</a>
			</h3>
		</header>
		<#nested>
	</article>
</#macro>

<!--评论模板-->
<#macro pagination currentPage totalPage url>
	<ul class="pagination pagination-sm">
		<#if currentPage==1>
			<li class="disabled"><a aria-label="Previous"><span aria-hidden="true">首页</span></a></li>
			<li class="disabled"><a aria-label="Previous"><span aria-hidden="true">&laquo;</span></a></li>
		<#else>
			<li><a href="${url}&pageNum=1" aria-label="Previous"><span aria-hidden="true">首页</span></a></li>
			<li><a href="${url}&pageNum=${currentPage-1}" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a></li>
		</#if>
		<#assign start = 1>
		<#assign end = totalPage>
		<#if currentPage-5 gt 0>
			<#assign start = currentPage-5>
		</#if>
		<#if currentPage+4 lt totalPage>
			<#assign end = currentPage+4>
		</#if>
		
		<#list start..end as pageNo>
			<#if pageNo == currentPage>
				<li class="active"><a href="${url}&pageNum=${pageNo}" >${pageNo} <span class="sr-only">(current)</span></a></li>
			<#else>
				<li><a href="${url}&pageNum=${pageNo}" >${pageNo} <span class="sr-only">(current)</span></a></li>
			</#if>
		</#list>
		<#if currentPage==totalPage>
			<li class="disabled"><a aria-label="Previous"><span aria-hidden="true">&raquo;</span></a></li>
			<li class="disabled"><a aria-label="Previous"><span aria-hidden="true">尾页</span></a></li>
		<#else>
			<li><a href="${url}&pageNum=${currentPage+1}" aria-label="Previous"><span aria-hidden="true">&raquo;</span></a></li>
			<li><a href="${url}&pageNum=${totalPage}" aria-label="Previous"><span aria-hidden="true">尾页</span></a></li>
		</#if>
	</ul>
</#macro>
